<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{php}if(preg_match('/iPad/si',$_SERVER['HTTP_USER_AGENT']) || preg_match('/iPhone/si',$_SERVER['HTTP_USER_AGENT'])){ {/php}
{include file='ios_webapp.tpl.html'}
{php}}{/php}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$title}</title>
<meta name="description" content="{$description}"/>
<meta name="keywords" content="{$keywords}"/>
{$style_sheets}
{$scripts}
{php}if(preg_match('/iPad/si',$_SERVER['HTTP_USER_AGENT']) || preg_match('/iPhone/si',$_SERVER['HTTP_USER_AGENT'])){ {/php}
<link rel="stylesheet" href="{$css_url}/ipad.css" type="text/css" />
{php}}{/php}
{php}if(preg_match('/Android/si',$_SERVER['HTTP_USER_AGENT'])){ {/php}
<link rel="stylesheet" href="{$css_url}/andriod.css" type="text/css" />
{php}}{/php}

</head>

<body>
<div align="center" id="body_warp">
	<div id="header_warp">
	{include file='system_header.tpl.html'}
	</div>
	<!--main warp-->
	<div id="main_warp">	
		<!--main-->
		<div id="main" >			
			{include file='system_loader.tpl.html'}
				<table id="main_content" border="0" cellpadding="0" cellspacing="10">
					<tr><td><img src="{$image_url}/spacer.gif" style="height:0px;" /></td></tr>
					<tr>
						<td valign="top" id="left_panel">
							{include file='system_left_panel.tpl.html'}					
						</td>
						<td valign="top" id="right_panel">
                                                        {include file='system_right_panel_tabs.tpl.html'}
						</td>
					</tr>
			  </table>		  
			</div>
			<!--main-->
		
		</div>		
		<!--main wrap end-->
		<!--footer-->
		<div  id="footer_warp">			
 		{include file='system_footer.tpl.html'}
		</div>
		<!-- footer end -->
	
	</div>
</div>

{literal}
<script>
$('main_loader_bg').style.height = $('main_content').offsetHeight+'px';
document.observe("Form:Load",SwitchTab);
var targetTabname;
function SwitchTab(){
	if(targetTabname){
		HideTabs();
		$('tab_form_'+targetTabname).show();
		$('tab_form_'+targetTabname).style.display='block';
		$('tab_link_'+targetTabname).className='current';
	}	
}
function ShowTab(tabname,formname,id){	
	targetTabname = tabname;
	Openbiz.CallFunction(formname+'.SelectRecord('+id+')');	
//	if(formname){	
//		if(Openbiz.getFormObject(formname).selectedId == Openbiz.getFormObject(formname).lastSelectedId){
//			SwitchTab();
//		}	
//	}
}
function HideTabs(){
	var tabs = $$('.tab_form');	
	for(i=0;i<tabs.length;i++) {	
	    tabs[i].style.display='none';	    
	}	

	var tab_links = $$('.tab_link');
	for(i=0;i<tab_links.length;i++) {
		tab_links[i].children[0].className='';
	}
}
function InitTabs(){
	fade_loader();
	var tabs = $$('.tab_form');
	for(i=0;i<tabs.length;i++) {	
	    tabs[i].style.display='none'; 		  
	}
	tabs[0].style.display='block';

	var tab_links = $$('.tab_link');
	for(i=0;i<tab_links.length;i++) {
		tab_links[i].children[0].className='';
	}
	tab_links[0].children[0].className='current';
//	window.setTimeout("init_first_tab()",1500);
}
window.onload=InitTabs;
</script>
{/literal}
{php}if(preg_match('/iPad/si',$_SERVER['HTTP_USER_AGENT']) || preg_match('/iPhone/si',$_SERVER['HTTP_USER_AGENT'])){ {/php}
<script src="{$js_url}/ios_webapp.js"></script>
{php}}{/php}
</body>
</html>